<template>
  <header class="header">
    <h1>小黑记事本</h1>
    <input placeholder="请输入任务" class="new-todo" v-model="todoName" @keyup.enter="Add"/>
    <button class="add" @click='Add'>添加任务</button>
  </header>
</template>

<script>
export default {
data() {
  return {
    todoName:''
  }
},
methods: {
  Add(){
    this.$emit('setName',this.todoName)
    this.todoName=''
  }
},
}
</script>

<style>

</style>